<template>
	<div class="ureport-designer" id="ureport-designer">
		<el-dialog title="报表设计" :close-on-click-modal="false" v-model="visible" width="95%" @close="refreshEmit" >
			<iframe v-show="iframeState" id="show-iframe"  frameborder=0 name="showHere" scrolling=auto :src="src" width="100%" height="800"></iframe>
		</el-dialog>
	</div>
</template>
<script lang="ts">
import { toRefs, reactive, defineComponent} from 'vue'
import {reportApi} from '/@/api/reportapi'
export default defineComponent({
	setup (props, ctx) {
		const state = reactive({
			visible: false,
			iframeState: true,
			src: ''
		})
		// 打开弹窗
		const openDialog = () => {
			state.visible = true
			state.src =import.meta.env.VITE_API_URL + reportApi().serverContextPath + '/ureport/designer'
		}
		const refreshEmit = () => {
				closeDialog()
				ctx.emit('refreshDataList')
			}
			// 关闭弹窗
			const closeDialog = () => {
				state.visible = false;
			}
		return{
			refreshEmit,
			closeDialog,
			openDialog,
			...toRefs(state),
		}
	}
})
</script>

<style>

</style>